<?php
require CWF_PATH.'libs/Smarty/Smarty.class.php';
//控制器基类
class Controller extends Smarty{
	function __construct()
	{
		$this->template_dir=TPL_PATH;
		$this->compile_dir=APP_NAME.'/Templates_c';
		is_dir($this->compile_dir) or mkdir($this->compile_dir,0755,true);
	}
	public function __set($var,$value){
		$this->assign($var,$value);
	}
	public function display($tpl=null)
	{
		无法重载父级的父级的display方法，请看Controller.class.php
	}

	/**
	 * 成功时显示方法
	 * @param  [type] $msg [description]
	 * @return [type]      [description]
	 */
	protected function success($message,$url=''){
		$this->assign('message',$message);
		$this->assign('url',$url);
		$this->display('success.html');
	}
	protected function error($message,$url=''){
		$this->assign('message',$message);
		$this->assign('url',$url);
		$this->display('error.html');	
	}

}